package com.example.demo.controller;

import com.example.demo.entity.Live;
import com.example.demo.entity.Stay;
import com.example.demo.service.StayService;
import com.example.demo.util.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/stay")
public class StayController {
    @Resource
    private StayService service;

    @RequestMapping(value = "/selectStay",method = RequestMethod.GET)
    public Result selectStay(Stay stay) {
        return service.selectStay(stay);
    }

    @RequestMapping(value = "/insertStay",method = RequestMethod.GET)
    public Result insertStay(Live live){
        return service.insertStay(live);
    }

    @RequestMapping(value = "/cancelStay",method = RequestMethod.GET)
    public Result cancelStay(Live live){
        return service.cancelStay(live);
    }

    @RequestMapping(value = "/abrogateStay",method = RequestMethod.GET)
    public Result abrogateStay(Live live){
        return service.abrogateStay(live);
    }
}
